import { genMessage } from '../helper';
import antdLocale from 'ant-design-vue/es/locale/zh_CN';
import vxeTableLocale from 'vxe-table/lib/locale/lang/zh-CN';
import { merge } from 'lodash-es';

const modulesFiles = import.meta.globEager('./zh-CN/**/*.ts');
const everyModulesFiles = import.meta.globEager('/src/modules/**/zh-CN/**/*.ts');
const frameworkFiles = import.meta.globEager('/src/framework/lang/zh-CN/**/*.ts');

const message = genMessage(modulesFiles, 'zh-CN');
const moduleMessage = genMessage(everyModulesFiles, 'zh-CN');
const frameworkMessage = genMessage(frameworkFiles, 'zh-CN');
merge(message, moduleMessage, frameworkMessage);

export default {
  message: {
    ...message,
    ...vxeTableLocale,
    antdLocale,
  },
};
